import 'package:gold/generated/json/base/json_convert_content.dart';
import 'package:gold/model/points_category_model.dart';

PointsCategoryModel $PointsCategoryModelFromJson(Map<String, dynamic> json) {
  final PointsCategoryModel pointsCategoryModel = PointsCategoryModel();
  final int? id = jsonConvert.convert<int>(json['id']);
  if (id != null) {
    pointsCategoryModel.id = id;
  }
  final String? title = jsonConvert.convert<String>(json['title']);
  if (title != null) {
    pointsCategoryModel.title = title;
  }
  return pointsCategoryModel;
}

Map<String, dynamic> $PointsCategoryModelToJson(PointsCategoryModel entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['id'] = entity.id;
  data['title'] = entity.title;
  return data;
}

extension PointsCategoryModelExtension on PointsCategoryModel {
  PointsCategoryModel copyWith({
    int? id,
    String? title,
  }) {
    return PointsCategoryModel()
      ..id = id ?? this.id
      ..title = title ?? this.title;
  }
}